/*
 *  directdynamic.h
 *  EPPI-0.0
 *
 *  Created by Juan Carlos Garcia Orden on 15/11/07.
 *
 */

#ifndef _directdynamic_h_
#define _directdynamic_h_

#include <iostream>
#include <map>
#include "analysis.h"
#include "simulation.h"
#include "integrator.h"


using namespace std;

//class Solver;
//class Simulation;
//class Process;

class DirectDynamic : public Analysis
{
public:
	double tIni, tEnd, tIncre;		/** Initial and final times, time increment */
	string linSolver;
	string nlSolver;
	string integratorName;
	double beta;
	double gamma;
	double alpha;
    int maxIter;
    double tol;
	vector<double> vTime;
	map<string, double, less<string> > intOptions;
//	vector<double> gravity;
	int numericTangFlag;
	double projPenalty;
	double deltaProjTol;
//	Solver integrator;
//	int gravDir;						/** Gravity direction */
//	double grav;						/** Gravity value */
/*	Data members from the base class Analysis
	string name;
	string type,
	int dim;
	bool haveToRebuild;
	bool changeLoads;
	Simulation* parentSim;
	bool isVelNeeded;
	string graphicsFormat;
	bool augLagFlag;
	bool augConvergence;
	bool augConvergenceTot;
	int augIter;
	int maxIterLambda;
	int integratorType;
 	bool projFlag;
	int autoProjFlag;
	string autoProjType;
	bool implicitFlag;
 	bool lumpedMassFlag;
*/

public:
	DirectDynamic();
        DirectDynamic(ifstream &, string &, string &, int, double, string &, string &, double &, Simulation*);
//	DirectDynamic(string &, string &, int, string, string, string, double, double, double, double, double, double, bool, bool, string &, Process*);
	~DirectDynamic(){};
	
	/** Virtual functions from base */
	string getLinSolver()	{ return(linSolver); }
	string getNlSolver()	{ return(nlSolver); }
	string getIntegrator()	{ return(integratorName); } // edit
	double getTIni()		{ return(tIni);	}
	double getTEnd()		{ return(tEnd);	}
	double getTIncre()		{ return(tIncre); }
	double getBeta()		{ return(beta); }
	double getGamma()		{ return(gamma); }
	double getAlpha()		{ return(alpha); }
	double calculate();
	
	/** Local functions */
	bool isImplicit(string&);	/** Check if this is an implicit integrator */
	void createTimeVec(ifstream &); // edit
	void calcCommand(){cout<<"well done\n";} // {parentSim->lProcess->myEvaluationImplicit(time);} // edit
	void readOptions (ifstream &);  // read Options for the Integration method

};

#endif
